// 重置定时器
export function startTimer(callback: any, delay: number) {
	let count = 0;
	let timerId = setInterval(() => {
		count++;
		callback(count);
	}, delay);

	return {
		stop() {
			clearInterval(timerId);
		},
		reset() {
			clearInterval(timerId);
			count = 0;
			timerId = setInterval(() => {
				count++;
				callback(count);
			}, delay);
		},
	};
}
